using System;
using System.Data;
using System.Runtime.Serialization;

namespace DetalleVenta.dbo.EN
{

    [Serializable]
    [System.Xml.Serialization.XmlType(Namespace="http://www.xpectro.biz/DetalleVenta/dbo/EN")]
    public class detalle_venta : XP.EN.EntidadGen<detalle_venta>
    {

        public const string TABLA = "dbo.detalle_venta";

        #region Constructores

        public detalle_venta()
            : base()
        {
        }
        protected detalle_venta(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        #endregion

        #region Propiedades

        public long? idventa
        {
            get { return this.GetValor<long>("idventa"); }
            set { this.SetValor("idventa", value); }
        }
        public long? idproducto
        {
            get { return this.GetValor<long>("idproducto"); }
            set { this.SetValor("idproducto", value); }
        }
        public int? cantidad
        {
            get { return this.GetValor<int>("cantidad"); }
            set { this.SetValor("cantidad", value); }
        }
        public double? precio
        {
            get { return this.GetValor<double>("precio"); }
            set { this.SetValor("precio", value); }
        }
        public double? subtotal
        {
            get { return this.GetValor<double>("subtotal"); }
            set { this.SetValor("subtotal", value); }
        }

        #endregion

        #region Métodos

        protected override void CrearEsquema()
        {
            this.datos.TableName = TABLA;
            this.datos.Rows.Add( new object[]{"idventa", null, Convert.ToInt32(DbType.Int64).ToString(), null, null, null, null, 0, 0});
            this.datos.Rows.Add(new object[]{"idproducto", null, Convert.ToInt32(DbType.Int64).ToString(), null, null, null, null, 0, 0});
            this.datos.Rows.Add(new object[]{"cantidad", null, Convert.ToInt32(DbType.Int32).ToString(), null, null, null, null, 0, 0});
            this.datos.Rows.Add(new object[]{"precio", null, Convert.ToInt32(DbType.Double).ToString(), null, null, null, null, 0, 0});
            this.datos.Rows.Add(new object[]{"subtotal", null, Convert.ToInt32(DbType.Double).ToString(), null, null, null, null, 0, 0});
        }

        #endregion

    }

}
